from weibo.models import Sina_Access_Token

def getWeiboInfoById(sid):
    """
    how to get weibo info by the id
    """
    tmpc = Sina_Access_Token.all().filter("sinaid =",sid).count() 
    if tmpc == 0:
        return None
    if tmpc == 1:
        return  Sina_Access_Token.all().filter("sinaid =",sid)[0]
    raise Exception("one sina id coresponse to more than one id")

